<template>
	<view>
		<view class="">
			<view class="kefu-daikuan">贷款相关</view>
			<view class="kefuList">
				<view class="questionOne" @click="questionClick(index)" v-for="(item,index) in DaiKuan">
					<span style="display: inline-block;">{{item.question}}</span>
					<image src="../../static/bottom.png" mode=""></image>
					<view :style="DkIndex == index ? 'display:block;':'display:none;'" class="answerOne">
						{{item.answer}}
					</view>
				</view>
				
			</view>
		</view>
		<view class="question-gongneng">
			<view class="kefu-daikuan">功能相关</view>
			<view class="kefuList">
				<view class="questionOne" v-for="(item,index) in GongNeng" @click="GNClick(index)">
					<span>{{item.question}}</span>
					<image src="../../static/bottom.png" mode=""></image>
					<view :style="GnIndex == index ? 'display:block;':'display:none;'" class="answerOne">
						{{item.answer}}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isanswer:false,
				DaiKuan:'',
				DkIndex:0,
				GongNeng:'',
				GnIndex:0
			}
		},
		onLoad() {
			var that = this;
			that.key = uni.getStorageSync('token');
			// if(that.key == '' || that.key == undefined){
			// 	uni.reLaunch({
			// 	    url: '../second/Sign'
			// 	});
			// }
			that.getQuestion();
		},
		methods: {
			getQuestion(){
				var that = this;
				that.$H.get('/question', {
				}, {
					native: false
				}).then(res => {
					that.Banner = res.data;
					that.DaiKuan = that.Banner[1].data;
					that.GongNeng = that.Banner[2].data;
					// console.log(that.Banner[2].data)
				})
			},
			questionClick(index){
				var that = this;
				that.DkIndex = index;
			},
			GNClick(index){
				var that = this;
				that.GnIndex = index;
			}
		}
	}
</script>

<style>
	page{
		background: #F8F8F8;
	}
	.kefu-daikuan{
		font-size: 36rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #000000;
		line-height: 90rpx;
		padding-left: 52rpx;
	}
	.questionOne{
		background: #FFFFFF;
		line-height: 110rpx;
		padding: 0 59rpx 0 51rpx;
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #000000;
	}
	.questionOne image{
		width: 33rpx;
		height: 18rpx;
		float: right;
		position: relative;
		top: 40rpx;
	}
	.question-gongneng{
		padding-bottom: 50rpx;
	}
	.answerOne{
		font-size: 28rpx;
		line-height: 36rpx;
		font-weight: 400;
		padding: 10rpx 15rpx 10rpx 0;
	}

</style>
